home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / kiss-0.11 / kiss-0 / kiss / src / Makefile < prev    next >
Makefile  |  1995-04-19  |  5KB  |  160 lines

  1. # Makefile for KISS
  2.  
  3. # The destination directory for a "make [rbg]install"
  4. BINDIR=/usr/local/bin
  5.  
  6. # Your favorite C compiler:
  7. CC = gcc
  8.  
  9. # Your installer, for "make (s)install": install or cp
  10. INSTALL = install
  11.  
  12. # Default compile flags:
  13. STDCFLAGS = -c -O2
  14.  
  15. # Warning level of compilation: I suggest -Wall
  16. WARNFLAG = -Wall
  17.  
  18. # Additional compile flags for readline usage:
  19. # You need to define USE_READLINE and to specifify the include dir,
  20. # if you don't have readline under /usr/include. I have readline under
  21. # /usr/local/include/readline.. If you don't want to compile with readline
  22. # at all, just leave this out.
  23. READLINECFLAGS =  -DUSE_READLINE -I/usr/local/include
  24.  
  25. # Additional compile flags for getline usage: Even if you don't have the
  26. # readline libs (see above) and/or headers, I suggest you try out getline -
  27. # it's a small readline-look-alike as far as command line editing goes.
  28. # It doesn't support file completion though (it has hooks for it.. any
  29. # potential heros out there?). The full sources for getline are under
  30. # the getline/ subdir under this directory.
  31. GETLINECFLAGS =  -DUSE_GETLINE -Igetline
  32.  
  33. # Additional compile flag for the bare version:
  34. BARECFLAGS = -DUSE_BARE
  35.  
  36. # Default linkage flags: -s gives stripping. Always included, in all versions.
  37. STDLFLAGS = -s
  38.  
  39. # Additional flags for readline: I have libreadline.a in /usr/local/lib,
  40. # and readline requires libtermcap.a. If you don't want to compile with
  41. # readline at all, just leave this out. Only included in "make rkiss".
  42. READLINELFLAGS = -L/usr/local/lib -lreadline -ltermcap
  43.  
  44. # Additional linkage flags for getline: libgetline.a gets built under
  45. # the subdir getline. Only included in "make gkiss".
  46. GETLINELFLAGS = -Lgetline -lgetline
  47.  
  48. # Thazzal! The rest should be ok.
  49. #-------------------------------
  50.  
  51. # objects that we're using
  52. OBJ = kiss.o parser.tab.o lex.yy.o yyerror.o setstring.o setquotedstring.o \
  53.       addstring.o clearstack.o setvariable.o warning.o getprogname.o \
  54.       dumpstack.o error.o runcmd.o runchild.o setexpandedstring.o \
  55.       sighandler.o getprompt.o banner.o redirected.o dokiss.o onechild.o \
  56.       launch.o docat.o catfile.o domore.o morefile.o dohelp.o docp.o \
  57.       copyfiletodir.o copyfiletofile.o copydirtodir.o runinternal.o docd.o \
  58.       doquit.o getinput.o doexec.o dohistory.o addtohistory.o dorecall.o \
  59.       islink.o getbasename.o setshlvl.o doprintenv.o dosetenv.o doecho.o \
  60.       dounsetenv.o addtoenv.o dover.o domv.o movefiletodir.o \
  61.       movefiletofile.o dowhere.o dorm.o dormdir.o removefile.o \
  62.       recursiveremove.o domkdir.o dopwd.o dochgrp.o dochmod.o doln.o \
  63.       doalias.o expandalias.o reexpand.o expandvars.o xmalloc.o xrealloc.o \
  64.       xstrdup.o command.o waitforchild.o file2file.o doread.o dosource.o \
  65.       sourcefile.o startupfiles.o isinternal.o isalias.o copystringstack.o \
  66.       addstringstack.o expandtilde.o splitcmd.o addstringtostack.o \
  67.       dokill.o dogrep.o dochown.o dosleep.o expandbackquotes.o dols.o \
  68.       listdir.o listfile.o listoutput.o domknod.o dowc.o domount.o \
  69.       doumount.o dotouch.o
  70.  
  71. # entry point for making
  72. foo:
  73.     @echo "Make what? Choose:"
  74.     @echo "    make rkiss - make program in this dir, with readline"
  75.     @echo "    make gkiss - make program in this dir, with getline"
  76.     @echo "    make bkiss - make program in this dir, without editing"
  77.     @echo "    make all - make readline, getline and bare versions"
  78.     @echo "    make rinstall - \"make rkiss\" and install to" $(BINDIR)
  79.     @echo "    make ginstall - \"make gkiss\" and install to" $(BINDIR)
  80.     @echo "    make binstall - \"make bkiss\" and install to" $(BINDIR)
  81.     @echo "    make clean - clean up stale files"
  82.     exit 1
  83.  
  84. # how to make readline version
  85. rkiss: always
  86.     touch lexer
  87.     make "CFLAGS=$(STDCFLAGS) $(READLINECFLAGS)" $(OBJ)
  88.     $(CC) -o rkiss.new $(OBJ) $(READLINELFLAGS) $(STDLFLAGS)
  89.     mv rkiss.new rkiss
  90.  
  91. # and install it
  92. rinstall: rkiss
  93.     $(INSTALL) rkiss $(BINDIR)
  94.  
  95. # how to make getline version
  96. gkiss: always
  97.     make -C getline libgetline.a
  98.     touch lexer
  99.     make "CFLAGS=$(STDCFLAGS) $(GETLINECFLAGS)" $(OBJ)
  100.     $(CC) -o gkiss.new $(OBJ) $(GETLINELFLAGS) $(STDLFLAGS)
  101.     mv gkiss.new gkiss
  102.  
  103. # and install it
  104. ginstall: gkiss
  105.     $(INSTALL) gkiss $(BINDIR)
  106.  
  107. # how to make bare version
  108. bkiss: always
  109.     touch lexer
  110.     make "CFLAGS=$(STDCFLAGS) $(BARECFLAGS)" $(OBJ)
  111.     $(CC) -o bkiss.new $(OBJ) $(STDLFLAGS)
  112.     mv bkiss.new bkiss
  113.  
  114. # and install it
  115. binstall: bkiss
  116.     $(INSTALL) bkiss $(BINDIR)
  117.  
  118. # how to make both versions:
  119. all:
  120.     make rkiss
  121.     make gkiss
  122.     make bkiss
  123.  
  124. always:
  125.     touch TimeStampOfCompilation
  126.  
  127. # extra: banner display needs version.h and subversion.h
  128. banner.o: banner.c version.h subversion.h
  129.  
  130. # extra: "ver" command needs version.h and subversion.h
  131. dover.o: dover.c version.h subversion.h
  132.  
  133. # how to make a new parser
  134. parser.tab.c: parser
  135.     bison -d parser
  136.  
  137. # how to make a new lexer
  138. lex.yy.c: lexer parser.tab.h
  139.     flex -I lexer
  140.  
  141. # suppress warnings on lexer
  142. lex.yy.o: lex.yy.c
  143.     @echo "Ignore any warnings in the lexer compilation"
  144.     $(CC) $(CFLAGS) lex.yy.c
  145.  
  146. # suppress warnings on parser
  147. parser.tab.o: parser.tab.c
  148.     @echo "Ignore any warnings in the parser compilation"
  149.     $(CC) $(CFLAGS) parser.tab.c
  150.  
  151. # cleanup: remove objects and intermediate files, but leave program
  152. clean:
  153.     rm -f $(OBJ) lex.yy.c parser.tab.c parser.tab.h a.out core \
  154.         TimeStampOfCompilation
  155.     make -C getline clean
  156.  
  157. # how to get from *.c to *.o
  158. .c.o:
  159.     $(CC) $(CFLAGS) $(WARNFLAG) $<
  160.